package com.hmdp;

import java.util.regex.Pattern;

public class PasswordValidator {
    public static void main(String[] args) {
        String password = "Qstation123";
        boolean isValid = validatePassword(password);
        System.out.println("密码是否有效： " + isValid);
    }

    public static boolean validatePassword(String password) {
        String regex = "^(?![0-9]+$)(?![A-Za-z]+$)(?![,./_*@!#%?$]+$)[0-9A-Za-z,./_*@!#%?$]{8,15}$";
        return Pattern.matches(regex, password);
    }
}
